-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Popover: write better docs regarding the recent API changes #44195
Conversation
@mirka it would be great if you could also take a look at the dev note, as part of the review 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what to do with the deprecations.md file — it looks like it hasn't been updated in some time
Yes, I think we can leave it alone at this point 😶
component also affected the
@wordpress/richt-text
Dev note looks good to me! Just one typo in the ☝️ package name here.
@@ -78,9 +79,10 @@ | |||
|
|||
## 20.0.0 (2022-08-24) | |||
|
|||
### Breaking Changes | |||
### Deprecations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for also updating the old ones 🙏
f8fc360
to
9573f35
Compare
What?
Following up from #43691 (comment), this PR:
Popover
componentBreaking Changes
toDeprecations
@mirka I'm not sure what to do with the deprecations.md file — it looks like it hasn't been updated in some time
Dev note
Note: this dev note is a collective dev note for the recent changes to the
Popover
component which aimed at addressing a spike of regressions happened recently, mostly tracked in #42770The
Popover
component from the@wordpress/components
package has been mostly rewritten, in an effort to make it more stable, more reliable and more performant. While doing so, one of the main goals was to avoid introducing breaking changes. Here is the list with the main API changes:placement
prop has been introduced. This prop is meant to replace the legacyposition
prop (which will be marked as deprecated in the near future)anchor
prop has been introduced. This prop is meant to replace all previous anchor-related props (anchorRef
,anchorRect
,getAnchorRect
). These older anchor-related props are now marked as deprecated and are scheduled to be removed in WordPress 6.3__unstableForcePosition
prop has been marked as deprecated, in favour of newflip
andresize
props. The__unstableForcePosition
is currently scheduled for removal in WordPress 6.3__unstableShift
prop has been marked as deprecated, in favour of theshift
prop. The__unstableShift
is currently scheduled for removal in WordPress 6.3__unstableObserveElement
prop has been removed, since it's not necessary anymore after the recent updates to thePopover
For more details, see the updated component's README and the Storybook examples.
The changes to the
Popover
component also affected the@wordpress/rich-text
, where a newuseAnchor
hook was introduced. The previoususeAnchorRef
hook has been marked as deprecated, and is scheduled to be removed in WordPress 6.3.Why?
The recent changes won't cause any breakage (apart from deprecation warnings in dev mode), and therefore should not be flagged as such.
We will flag correctly the breaking changes in future versions of Gutenberg, when we will delete those deprecated props.
How?
Editing the docs